home *** CD-ROM | disk | FTP | other *** search
/ Clickx 115 / Clickx 115.iso / software / tools / windows / tails-i386-0.16.iso / live / filesystem.squashfs / usr / include / scribus-ng / scrpalettebase.h < prev    next >
Encoding:
C/C++ Source or Header  |  2007-09-06  |  3.2 KB  |  81 lines

  1. /*
  2. For general Scribus (>=1.3.2) copyright and licensing information please refer
  3. to the COPYING file provided with the program. Following this notice may exist
  4. a copyright and/or license notice that predates the release of Scribus 1.3.2
  5. for which a new license (GPL+exception) is in place.
  6. */
  7. /***************************************************************************
  8.  *   Copyright (C) 2005 by Craig Bradney                                   *
  9.  *   cbradney@scribus.info                                                 *
  10.  *                                                                         *
  11.  *   This program is free software; you can redistribute it and/or modify  *
  12.  *   it under the terms of the GNU General Public License as published by  *
  13.  *   the Free Software Foundation; either version 2 of the License, or     *
  14.  *   (at your option) any later version.                                   *
  15.  *                                                                         *
  16.  *   This program is distributed in the hope that it will be useful,       *
  17.  *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
  18.  *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
  19.  *   GNU General Public License for more details.                          *
  20.  *                                                                         *
  21.  *   You should have received a copy of the GNU General Public License     *
  22.  *   along with this program; if not, write to the                         *
  23.  *   Free Software Foundation, Inc.,                                       *
  24.  *   59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.             *
  25.  ***************************************************************************/
  26. #ifndef SCRPALETTE_BASE_H
  27. #define SCRPALETTE_BASE_H
  28.  
  29. #include <QCloseEvent>
  30. #include <QDialog>
  31. #include <QHideEvent>
  32. #include <QKeySequence>
  33.  
  34. #include "scribusapi.h"
  35. class PrefsContext;
  36.  
  37. class SCRIBUS_API ScrPaletteBase : public QDialog
  38. {
  39.     Q_OBJECT
  40.  
  41.     public:
  42.         ScrPaletteBase( QWidget * parent = NULL, const QString& prefsContext = QString::null, bool modal = false, Qt::WFlags f = 0 );
  43.         ~ScrPaletteBase() {};
  44.         /** @brief Sample way to grab keystrokes, simply calls superclass at this point */
  45.         //virtual void keyPressEvent(QKeyEvent *keyEvent);
  46.         /** @brief Captures the close event and changes it to hide */
  47.         virtual void closeEvent(QCloseEvent *closeEvent);
  48.         /** @brief Stores the geometry of the window when hiding. */
  49.         void hideEvent(QHideEvent*);
  50.         virtual void show();
  51.         virtual void hide();
  52.         void startup();
  53.         
  54.     public slots:
  55.         virtual void setPaletteShown(bool);
  56.         virtual void setFontSize();
  57.         int exec(QWidget* newParent);
  58.         
  59.     signals:
  60.         /** @brief Let the action for this palette know when something changes and it hasnt caused it */
  61.         void paletteShown(bool);
  62.         
  63.     protected:
  64.         /** @brief Set the Preferences context to be used for storage of startup visibility and position and size */
  65.         virtual void setPrefsContext(QString context);
  66.         void storePosition();
  67.         void storePosition(int newX, int newY);
  68.         void storeSize();
  69.         void storeVisibility(bool);
  70.         
  71.         PrefsContext* palettePrefs;
  72.         QString prefsContextName;
  73.         bool visibleOnStartup;
  74.         QWidget* originalParent;
  75.         QWidget* tempParent;
  76.         
  77.     protected slots:
  78.         virtual void reject();
  79. };
  80. #endif
  81.